<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>Role PreAdd</title>
        <%include("../inc/editCss.html"){};%>

	</head>
	<body class="no-skin">
		<div class="container-fluid">
			<div class="row">
			  <div class="breadcrumbs">
				<ul class="breadcrumb">
					<li><i class="ace-icon fa fa-home home-icon"></i><a href="../index.jspx" target="_top">首页</a></li>
					<li><a href="list.jspx">角色信息</a></li>
					<li class="active">新增</li>
				</ul>
				  <!-- /.breadcrumb -->
			  </div>
			  <!-- /.breadcrumbs -->
			</div>
			<!-- /.row -->
			<div class="row">
				<div class="page-content">
					<div class="page-header">
						<h1>角色信息添加</h1>
					</div>
					<div class="row">
						<div class="col-xd-12">
						    <form action="addEx.jspx" method="post" class="form-horizontal" role="form" id="form-data">
						    	<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right"> 名称(<span class="red">*</span>)  </label>
									<div class="col-sm-2">
										<input type="text" id="name" name="name" placeholder="名称" class="col-sm-12" />
									</div>
									<label class="col-sm-1 control-label no-padding-right"> 标识(<span class="red">*</span>)  </label>
									<div class="col-sm-2">
										<input type="text" id="identity" name="identity" placeholder="标识" class="from-control" />
									</div>
									<label class="col-sm-1 control-label no-padding-right">  首页地址(<span class="red">*</span>)  </label>
									<div class="col-sm-4">
										<input type="text" id="index" name="index" placeholder="首页地址" class="col-sm-12" />
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right"> 包含资源(<span class="red">*</span>)  </label>
									<div class="col-sm-10 role-resource">
										<%for(resource in resources!){%>
										<dl class="col-sm-5" style="border:1px solid #ccc; margin:0 10px;">
											<dt style="font-weight:bold">
												<label><input type="checkbox" id="resource_${resource.id!0}" name="resourceIds" value="${resource.id!0}"> ${resource.name!'未知'}</label>
												（<%for(permission in permissions!){%>
													<label><input type="checkbox" id="permission_${resource.id!0}_${permission.id!0}" name="permission_${resource.id!0}" value="${permission.id!0}"> ${permission.name!'未知'}</label>
												<%}%>
                                                                                                       ）
											</dt>
											<%for(subresource in resource.subresources!){%>
                                            <dd style="margin-left:20px">
                                                <label><input type="checkbox" id="resource_${subresource.id!0}" name="resourceIds" value="${subresource.id!0}"> ${subresource.name!'未知'}</label>
                                                <br/>
                                                                                                  （<%for(permission in permissions!){%>
													<label><input type="checkbox" id="permission_${resource.id!0}_${permission.id!0}" name="permission_${resource.id!0}" value="${permission.id!0}"> ${permission.name!'未知'}</label>
												<%}%>
                                                                                                       ）
												<%if(subresource.hasChild==true){%>
													<dl style="margin-left:30px;border:1px dashed #ccc">
														<%for(subresource2 in subresource.subresources!){%>
				                                            <dd>
				                                                <label><input type="checkbox" id="resource_${subresource2.id!0}" name="resourceIds" value="${subresource2.id!0}"> ${subresource2.name!'未知'}</label>
				                                                <br/>
								                                                                    （<%for(permission in permissions!){%>
																	<label><input type="checkbox" id="permission_${resource2.id!0}_${permission.id!0}" name="permission_${resource.id!0}" value="${permission.id!0}"> ${permission.name!'未知'}</label>
																<%}%>
				                                                                                                       ）
														       </dd>
														 <%}%>
													</dl>
											    <%}%>
                                            </dd>
											<%}%> 
										</dl>
										<%}%>
									</div>
								</div>
								<div class="space-4"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label no-padding-right">添加时间</label>
									<div class="col-sm-3">
										<input type="text" name="addtime" value="${date(),'yyyy-MM-dd HH:mm:ss'}">
									</div>
								</div>
								<div class="clearfix form-actions">
									<div class="col-sm-offset-2 col-sm-4">
										<button type="reset" class="btn">
											<i class="ace-icon fa fa-undo bigger-110"></i>
											重置
										</button>
										&nbsp;&nbsp;
										<button type="submit" class="btn btn-info">
											<i class="ace-icon fa fa-check bigger-110"></i>
											提交
										</button>
									</div>
								</div>
						    </form>
					    </div>
					</div>
					<!-- /.row -->
				</div>
				<!-- /.page-content -->
			</div>
		</div>
		<%include("../inc/editJs.html"){};%>
		<script>
			$(document).ready(function(){
				root.manage.role.validate();
			});
		</script>
	</body>
</html>